<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            display: flex;
        }
    </style>
</head>
<body>
    <div>
        <span>手机：</span>
        <input type="text" placeholder="请输入手机号码">
        <button>发送</button>
    </div>
    <script>
        //1.点击发送按钮，让发送按钮禁用；然后改变按钮里面的文字
        var btn = document.querySelector("button")
        var timeC = 3;
        btn.addEventListener("click",function(){
            //2.让秒数进行倒计时
            var timer = setInterval(function(){
                //3.判断如果时间倒数到0 则恢复按钮的状态和文字，否则一直倒数
                if(timeC === 0){
                    btn.disabled = false
                    btn.innerHTML = "发送"
                    timeC = 3
                    clearInterval(timer)
                }else{
                    btn.disabled = true
                    btn.innerHTML = '还剩'+timeC+'s'
                    timeC --;
                }
            },1000)
        })
    </script>
</body>
</html>